<template>
    <div id="forgetPassword" class="loginRegister">
        <header class="header">
            <i class="iconfont icon-zuojiantou" @click="$router.back(-1)"></i>
            <h1>找回密码</h1>
        </header>
        <form id="forgetPasswordForm">
            <div class="loginRegister_frame">
                <div class="input_list">
                    <i class="iconfont icon-zhanghao"></i>
                    <input type="text" name="accountTxt" placeholder="手机号／邮箱" />
                </div>                 
            </div>
            <div class="loginRegister_btn">
                <button type="button" class="submit_btn" @click="submitForm('#forgetPasswordForm')">下一步</button>
            </div>
        </form>
        <div class="error_warning">
            <span class="error_txt">
                账号不能为空
            </span>
        </div>    
    </div>
</template>

<script>
export default {
    name: 'forgetPassword',
    data() {
        return {
            
        }
    },
    created() {
	  
    },
    mounted() {
        
    },
    methods: {
        //提交form
        submitForm(obj) {
            var that = this;
            var $account = $(obj).find('input[name=accountTxt]'),
                accountTxt = $.trim($account.val());
            if(accountTxt == '') {
                this.utils.errorWarning('账号不能为空');
                return false;
            }
            var phoneReg = this.utils.phoneReg,  //手机号正则
                emailReg = this.utils.emailReg;  //邮箱正则
            if(!phoneReg.test(accountTxt) && !emailReg.test(accountTxt)) {
                this.utils.errorWarning('账号不存在');
                return false;
            }
            /* $.ajax({
                url: this.appUrl+"/reportDev/reportDevAction!getRateQuarterlDetail.htm",
                type: 'post',
                data: {
                    yearMonth: this.timeUnit.value
                },
                success: function(data) {
                },
                error: function(data) {
                }
            }) */
            that.$router.push({ name: 'getBackPassword', query: { account: accountTxt }})
        }
    }
}
</script>

<style lang="scss" scoped>
#forgetPasswordForm {
    padding-top: 2.666667rem;
    margin: 0 .533333rem; 
}
.loginRegister_frame {
    padding-bottom: 20px;
    .input_list {
        background: #fff;
        margin: 0 0 .533333rem;
        border-radius: .213333rem;
        padding: .213333rem .32rem;
        display: flex;
        i.iconfont {
            padding-right: 10px;
            border-right: 1px solid #414568;
            &:before {
                margin-top: -2px;
                display: block;
            }
        }
    }
}
</style>
